<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">{- |
   Module      :  System.Win32.Thread
   Copyright   :  2013 shelarcy
   License     :  BSD-style

   Maintainer  :  shelarcy@gmail.com
   Stability   :  Provisional
   Portability :  Non-portable (Win32 API)

   This modules provides just thread control APIs.
   This modules doesn't provide thread register control APIs. Because these APIs are used for Debugging.
-}</span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Win32.Thread</span><span>
</span><span id="line-15"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#THANDLE"><span class="hs-identifier">THANDLE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#TID"><span class="hs-identifier">TID</span></a></span><span>
</span><span id="line-16"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.Thread.html#getCurrentThread"><span class="hs-identifier">getCurrentThread</span></a></span><span>
</span><span id="line-17"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#suspendThread"><span class="hs-identifier">suspendThread</span></a></span><span>
</span><span id="line-18"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#resumeThread"><span class="hs-identifier">resumeThread</span></a></span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#withSuspendedThread"><span class="hs-identifier">withSuspendedThread</span></a></span><span>
</span><span id="line-20"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.Thread.html#getThreadId"><span class="hs-identifier">getThreadId</span></a></span><span>
</span><span id="line-21"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.Thread.html#getCurrentThreadId"><span class="hs-identifier">getCurrentThreadId</span></a></span><span>
</span><span id="line-22"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html"><span class="hs-identifier">System.Win32.DebugApi</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Win32.Types.html"><span class="hs-identifier">System.Win32.Types</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="System.Win32.Types.html#failIfZero"><span class="hs-identifier">failIfZero</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">

#include &quot;windows_cconv.h&quot;
</span><span>
</span><span id="line-29"></span><span class="annot"><a href="System.Win32.Thread.html#getThreadId"><span class="hs-identifier hs-type">getThreadId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#THANDLE"><span class="hs-identifier hs-type">THANDLE</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#TID"><span class="hs-identifier hs-type">TID</span></a></span><span>
</span><span id="line-30"></span><span id="getThreadId"><span class="annot"><span class="annottext">getThreadId :: THANDLE -&gt; IO TID
</span><a href="System.Win32.Thread.html#getThreadId"><span class="hs-identifier hs-var hs-var">getThreadId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO TID -&gt; IO TID
forall a. (Eq a, Num a) =&gt; String -&gt; IO a -&gt; IO a
</span><a href="System.Win32.Types.html#failIfZero"><span class="hs-identifier hs-var">failIfZero</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GetThreadId&quot;</span></span><span> </span><span class="annot"><span class="annottext">(IO TID -&gt; IO TID) -&gt; (THANDLE -&gt; IO TID) -&gt; THANDLE -&gt; IO TID
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">THANDLE -&gt; IO TID
</span><a href="System.Win32.Thread.html#c_GetThreadId"><span class="hs-identifier hs-var">c_GetThreadId</span></a></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="annot"><a href="System.Win32.Thread.html#getCurrentThreadId"><span class="hs-identifier hs-type">getCurrentThreadId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#TID"><span class="hs-identifier hs-type">TID</span></a></span><span>
</span><span id="line-33"></span><span id="getCurrentThreadId"><span class="annot"><span class="annottext">getCurrentThreadId :: IO TID
</span><a href="System.Win32.Thread.html#getCurrentThreadId"><span class="hs-identifier hs-var hs-var">getCurrentThreadId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO TID -&gt; IO TID
forall a. (Eq a, Num a) =&gt; String -&gt; IO a -&gt; IO a
</span><a href="System.Win32.Types.html#failIfZero"><span class="hs-identifier hs-var">failIfZero</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GetThreadId&quot;</span></span><span> </span><span class="annot"><span class="annottext">IO TID
</span><a href="System.Win32.Thread.html#c_GetCurrentThreadId"><span class="hs-identifier hs-var">c_GetCurrentThreadId</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetCurrentThread&quot;</span><span>
</span><span id="line-36"></span><span>    </span><span id="getCurrentThread"><span class="annot"><a href="System.Win32.Thread.html#getCurrentThread"><span class="hs-identifier hs-var">getCurrentThread</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#THANDLE"><span class="hs-identifier hs-type">THANDLE</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetThreadId&quot;</span><span>
</span><span id="line-39"></span><span>    </span><span id="c_GetThreadId"><span class="annot"><a href="System.Win32.Thread.html#c_GetThreadId"><span class="hs-identifier hs-var">c_GetThreadId</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#THANDLE"><span class="hs-identifier hs-type">THANDLE</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#TID"><span class="hs-identifier hs-type">TID</span></a></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetCurrentThreadId&quot;</span><span>
</span><span id="line-42"></span><span>    </span><span id="c_GetCurrentThreadId"><span class="annot"><a href="System.Win32.Thread.html#c_GetCurrentThreadId"><span class="hs-identifier hs-var">c_GetCurrentThreadId</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Win32.DebugApi.html#TID"><span class="hs-identifier hs-type">TID</span></a></span><span>
</span><span id="line-43"></span></pre></body></html>